#ifndef _MODTYPE_H_
#define _MODTYPE_H_
#include "SimpleNode.h"
class IVisitor;
class modType;
typedef QSharedPointer<modType> modTypePtr;

class modType: public SimpleNode
{
public:
    explicit modType(int nodeId=-1);
    virtual ~modType();
    
    
    
    virtual QString type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<modTypePtr> ModTypePtrListIterator;

class ModTypeList: public QList<modTypePtr>
{
public:
    inline ModTypeList() { }
    inline explicit ModTypeList(modTypePtr i) { append(i); }
    inline ModTypeList(const ModTypeList &l) : QList<modTypePtr>(l) { }
    inline ModTypeList(const QList<modTypePtr> &l) : QList<modTypePtr>(l) { }

    inline ModTypeList operator+(const ModTypeList &other) const
    { ModTypeList n = *this; n += other; return n; }
    inline ModTypeList &operator<<(modTypePtr it)
    { append(it); return *this; }
    inline ModTypeList &operator<<(const ModTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("ModTypeList(");
        foreach(modTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(modTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif